{extend name='admin@public/content'}

{block name="content"}
<form autocomplete="off" onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>
    <div class="form-group">
        <label class="col-sm-2 control-label">所属层级</label>
        <div class='col-sm-8'>
            <select name='pid' class='layui-select full-width' lay-ignore>
                <!--{foreach $menus as $menu}-->
                <!--{eq name='menu.id' value='$vo.pid|default=0'}-->
                <option selected value='{$menu.id}'>{$menu.spl|raw}{$menu.name}</option>
                <!--{else}-->
                <option value='{$menu.id}'>{$menu.spl|raw}{$menu.name}</option>
                <!--{/eq}-->
                <!--{/foreach}-->
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">导航名称</label>
        <div class='col-sm-8'>
            <input autofocus name="name" value='{$vo.name|default=""}'  required="required" pattern="^.{2,}$" title="导航名称" placeholder="请输入两位以上的导航名称" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">导航链接</label>
        <div class='col-sm-8'>
            <input autofocus name="link" value='{$vo.link|default=""}'  title="导航链接" placeholder="导航链接 例如：link/index" class="layui-input">
        </div>
    </div>


    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}<input type="hidden" name="id" value="{$vo.id}">{/if}
            <button class="layui-btn" type="submit">保存配置</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消编辑</button>
        </div>
    </div>

    <script>window.form.render();</script>
</form>
{/block}